<template>
  <div v-if="visible" class="modal-overlay">
    <div class="modal-container">
      <button class="close-button" @click="$emit('close')">关闭</button>
      <h3>详细信息</h3>
      <table class="custom-table">
        <thead>
          <tr>
            <th>工号</th>
            <th>姓名</th>
            <th>技能等级</th>
            <th>所在岗位</th>
            <th>所在工位</th>
            <th>所在站位</th>
            <th>所在产线</th>
          </tr>
        </thead>
        <tbody>
         <tr v-for="(worker, index) in workerp" :key="index">
            <td>{{ worker.number }}</td>
            <td>{{ worker.name }}</td>
            <td>{{ worker.grade }}</td>
            <td>{{ worker.position1 }}</td>
            <td>{{ worker.position2 }}</td>
            <td>{{ worker.position3 }}</td>
            <td>{{ worker.line }}</td>
          </tr>
        </tbody>
      </table>

    </div>
  </div>
</template>

<script>


export default {
  name: 'ModalModalp',

  props: {
    visible: {
      type: Boolean,
      required: true
    },
    workerp: {
      type: Array,
      required: true
    },
  },

};

</script>

<style scoped>
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-container {
  background: white;
  padding: 20px;
  border-radius: 5px;
  width: 80%;
  max-width: 600px;
}

.close-button {
  position: absolute;
  top: 10px;
  right: 10px;
}
</style>
